/* components/article-card/article-card.wxss */
// 变量定义
$card-bg-color: #ffffff;
$card-radius: 16rpx;
$card-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
$card-hover-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.1);
$text-primary: #333333;
$text-secondary: #666666;
$text-tertiary: #999999;
$border-color: #eeeeee;
$primary-color: #1677ff;
$tag-color: #ff7d00;

// 混合器
@mixin flex-center {
  display: flex;
  align-items: center;
}

@mixin transition($property: all, $duration: 0.3s) {
  transition: $property $duration ease;
}

.article-card {
  background-color: $card-bg-color;
  border-radius: $card-radius;
  box-shadow: $card-shadow;
  padding: 24rpx;
  @include transition;
  
  &:hover {
    transform: translateY(-4rpx);
    box-shadow: $card-hover-shadow;
  }
  
  // 卡片点击区域
  .card-container {
    @include flex-center;
    flex-direction: column;
    width: 100%;
  }
  
  // 文章图片
  .article-image {
    width: 100%;
    height: 320rpx;
    border-radius: 12rpx;
    overflow: hidden;
    margin-bottom: 20rpx;
    
    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      @include transition;
    }
    
    &:hover img {
      transform: scale(1.03);
    }
  }
  
  // 文章标题
  .article-title {
    font-size: 32rpx;
    font-weight: bold;
    color: $text-primary;
    line-height: 1.4;
    margin-bottom: 16rpx;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  // 文章标签
  .article-tags {
    display: flex;
    gap: 12rpx;
    margin-bottom: 16rpx;
    flex-wrap: wrap;
    
    .tag {
      font-size: 24rpx;
      color: $tag-color;
      background-color: rgba(255, 125, 0, 0.1);
      padding: 4rpx 16rpx;
      border-radius: 20rpx;
    }
  }
  
  // 文章摘要
  .article-summary {
    font-size: 26rpx;
    color: $text-secondary;
    line-height: 1.5;
    margin-bottom: 20rpx;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  // 底部信息区
  .article-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16rpx;
    border-top: 1px solid $border-color;
    
    // 作者信息
    .author-info {
      @include flex-center;
      gap: 12rpx;
      
      .author-avatar {
        width: 48rpx;
        height: 48rpx;
        border-radius: 50%;
        overflow: hidden;
        
        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
        }
      }
      
      .author-name {
        font-size: 26rpx;
        color: $text-secondary;
        white-space: nowrap;
      }
    }
    
    // 统计信息
    .stats {
      @include flex-center;
      gap: 24rpx;
      
      .stat-item {
        @include flex-center;
        gap: 6rpx;
        font-size: 24rpx;
        color: $text-tertiary;
        
        .icon {
          width: 24rpx;
          height: 24rpx;
        }
        
        &.like {
          @include transition;
          
          &:active {
            color: $primary-color;
          }
        }
      }
    }
  }
}
